/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package edu.asu.cse360.client.action;

import edu.asu.cse360.client.context.RestaurantContext;
import edu.asu.cse360.client.ui.frame.AppFrame;
import edu.asu.cse360.client.ui.frame.LoginFrame;
import java.awt.event.ActionEvent;
import javax.swing.AbstractAction;

/**
 *This class is called when the employee wants to log out
 * @author Steven
 */
public class LogoutAction extends AbstractAction {
    public LogoutAction()
    {
        super("Logout");

        
    }
    public void actionPerformed(ActionEvent e)
    {
        RestaurantContext.setRestaurant(null);
        RestaurantContext.setTable(null);
        RestaurantContext.setloggedInUser(null);
        AppFrame appframe = AppFrame.getAppFrame();
        LoginFrame loginframe = LoginFrame.getLoginFrame();
        loginframe.setVisible(true);
        loginframe.clearField();
        
    }

}
